<?php
namespace app\index\model;

use think\Model;

class cossign extends Model
{
    public function addsign($course_Id,$class_Id,$sign_Id){
        $Data = [
            "course_Id" => $course_Id,
            "class_Id" => $class_Id,
            "sign_Id" => $sign_Id,
        ];
        return $this->insert($Data);
    }

    public function student($sign_Id){
        $data= $this->alias('cos')
                    ->join('ss','cos.class_Id = ss.class_Id')
                    ->join('user u','ss.student_Id = u.Id')
                    ->where('cos.sign_Id',$sign_Id)
                    ->where('ss.student_status',1)
                    ->select();
        return $data;
    }

    public function result(){
        return $this->hasMany('Ordsign','sign_Id','sign_Id');
    } 
}
?>